package com.gec.hawaste.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gec.hawaste.entity.Examine;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gec.hawaste.vo.ExamineVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author lisongsong
 * @since 2022-04-21
 */
public interface ExamineMapper extends BaseMapper<Examine> {

    // mybatisplus 中动态拼接  sql
    // 固定的占位符   ${ew.customSqlSegment}
    // 扩展 默认mybatisplus 中 mapper 接口的方法
    // 连表查询
    @Select("SELECT examine.*, " +
            "       sys_office.name office_name, " +
            "       sys_user.name user_name " +
            " " +
            "from examine, " +
            "sys_user, " +
            "sys_office ${ew.customSqlSegment}")
    public IPage<ExamineVo> selectExamineVoByCondition(IPage<ExamineVo> page, @Param("ew") Wrapper ew);

}
